package com.cloudcross.ssp.common.utils;

import java.security.MessageDigest;

public class Md5Tool {

    public static String getMd5(String password) {
        String str = "";
        if (password != null && !password.equals("")) {
            try {
                MessageDigest md = MessageDigest.getInstance("MD5");
                //加密后的字符串
                str = EncryptionUtils.base64Encode(md.digest(password.getBytes("utf-8")));
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
        return str;
    }

    public static void main(String[] args) {
        System.err.println(getMd5("duwuqiang"));
    }
}
